<%@ page import="java.util.Date" %><%--
  Created by IntelliJ IDEA.
  User: admin
  Date: 2021/4/23
  Time: 4:23 下午
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<style>
    #content_body img{
        width: 80px;
        height: 80px
    }

    /*.text_slice {*/
    /*    width: 250px;*/
    /*    display: block;*/
    /*    overflow: hidden;*/
    /*    white-space: nowrap;*/
    /*    text-overflow: ellipsis;*/
    /*}*/
    #div1{

        width: 100%;
        height: 120px;
        buttom:0;
    }
    /*#footer{*/
    /*    width: 100%;*/
    /*    height: 55px;*/
    /*    background: rgba(1,0,0,0.4);*/
    /*    !*background-color: #000;*!*/
    /*    !*opacity: 0.4;*!*/
    /*    position: fixed;*/
    /*    bottom: 0;*/
    /*}*/


</style>
<div class="table-responsive">

    <table class="table">
        <caption style="text-align: center">我的景点收藏</caption>
        <tr>
        </tr>
        <thead>
        <tr>
            <th>序号</th>
            <th>产品图</th>
            <th>产品名称</th>
            <th>产品单价</th>
            <th>操作</th>

        </thead>
        <tbody id="content_body">
            <c:forEach items="${pageInfo.list}" var="c" varStatus="vs">
                <tr>
<%--                    <td><input type="checkbox" onclick="checks(this)" ></td>--%>
                    <td>${vs.count}</td>
                    <td><img src="http://localhost:80/product/${c.productImg}"></td>
                    <td>${c.productName}</td>
                    <td>${c.productPrice}</td>



                    <td><button class="btn btn-link text-danger" onclick="del(this,${c.id})"><span class="text-danger glyphicon glyphicon-trash"></span>
                    </button>
                    </td>

                </tr>
            </c:forEach>
        </tbody>
    </table>
    <div id = "div1">
        <%@include file="../common/page3.jsp"%>

    </div>


<script>
    function del(obj,id) {

    layui.use(['layer'], function(){
        let layer = layui.layer;

        layer.confirm('is not?', {icon: 3, title:'提示'}, function(index)
            {
// $.post('/mac/login/carts/del',{"id":id},function(data){
                $.post('/mac/login/collect/del',{"id":id},function (data) {
                    if(data.code == "200")
                    {
                        $(obj).parent().parent().remove();
                        layer.msg('删除成功',{icon:6});
                    }

                    else
                    {
                        layer.msg('删除失败',{icon:6});
                    }
                })

            }
        )
    })
}

</script>>

